package com.hernie.piggymall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hernie.common.utils.PageUtils;
import com.hernie.piggymall.product.entity.CategoryEntity;
import com.hernie.piggymall.product.vo.Catalog2Vo;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author HuangJp
 * @email HuangJp@gmail.com
 * @date 2022-02-16 22:55:11
 */
public interface CategoryService extends IService<CategoryEntity> {

    PageUtils queryPage(Map<String, Object> params);

    List<CategoryEntity> listWithTree();

    void removeMeunByIds(List<Long> idList);

    /**
     * 找到catelogId的完整路径
     * @param catelogId 叶子节点ID
     * @return  完整三级菜单ID数组[一级/二级/三级]
     */
    Long[] findCatelogPath(Long catelogId);

    // 级联更新
    void updateCascade(CategoryEntity category);

    List<CategoryEntity> getRootCategories();

    Map<String, List<Catalog2Vo>> getCategoryJson();
}

